#ifndef LOADINGDIALOG_H
#define LOADINGDIALOG_H

#include <QDialog>
#include <QLabel>
#include <QHBoxLayout>
#include <QLabel>

class QTimer;

class LoadingDialog : public QWidget
{
    Q_OBJECT
public:
    LoadingDialog(QWidget *parent = nullptr);
    virtual ~LoadingDialog();

public Q_SLOTS:
    void onLoading();

protected:
    void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
    void closeEvent(QCloseEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;

private:
    QHBoxLayout *m_layoutMain = nullptr;
    QLabel *m_labelLoading = nullptr;
    QTimer *m_timerLoading = nullptr;
    int m_nCurTick = 0;
    unsigned long long m_lluInitTick = 0;
};

#endif // LOADINGDIALOG_H
